package edu.sctu.wangxiaoqiang.projectOne;

/**
 * Created by user25 on 2015/5/31.
 */
public class SecurityCheck {


    String[] bag = new String[]{"炸弹", "管制刀具", "枪"};
    String[] water = new String[]{"汽油", "酒精", "硫酸"};
    static int m = 0;

    /**
     * 安检
     * @param thing
     */

    public void waterJudge(String thing) {

        for (int i = 0, j = 0; i < water.length; i++) {
            if (thing.equals(water[i])) {
                System.out.println("此人带有危险品:" + thing + "!扣留");
                break;
            } else if (!thing.equals(water[i])) {
                j++;
                this.m = j;

                continue;
            }
        }
        if (this.m == water.length) {
            System.out.println("通过");
        }
/**
 * 安检
 */

    }
    public void bagJudge(String thing) {

        for (int i = 0, j = 0; i < bag.length; i++) {
            if (thing.equals(bag[i])) {
                System.out.println("此人带有危险品:" + thing + "!扣留");
                break;
            } else if (!thing.equals(bag[i])) {
                j++;
                this.m = j;

                continue;
            }
        }
        if (this.m == bag.length) {
            System.out.println("通过");
        }
    }

}
